import {combineReducers, ReducersMapObject, Reducer} from 'redux';
import {connectRouter} from 'connected-react-router';
import history from '../history';
import home from './home';
import cart from './cart'
import mine from './mine';
import profile from './profile';

let reducers: ReducersMapObject = {
    router: connectRouter(history),
    home,
    cart,
    mine,
    profile
}

type CombineState = {
    [key in keyof typeof reducers]: ReturnType<typeof reducers[key]>
}

let reducer: Reducer<CombineState> = combineReducers<CombineState>(reducers);

export default reducer;